#!/bin/sh

# Name of binary package.
PKG_OPENLDAP_SERVER='openldap-server-2.3.33p1-bdb'

# Path of port: openldap.
PORT_OPENLDAP='/usr/ports/database/openldap/'

# Path of port: phpldapadmin.
PORT_PHPLDAPADMIN='/usr/ports/www/phpldapadmin'

# Args to build port: openldap.
PORT_OPENLDAP_BUILD='env FLAVOR="bdb" SUBPACKAGE="-server" make install clean'

OPENLDAP_ROOTDIR="/etc/openldap"
OPENLDAP_SCHEMA_DIR="${OPENLDAP_ROOTDIR}/schema"
OPENLDAP_SLAPD_CONF="${OPENLDAP_ROOTDIR}/slapd.conf"
OPENLDAP_LDAP_CONF="${OPENLDAP_ROOTDIR}/ldap.conf"
OPENLDAP_LOGFILE='/var/log/openldap'
OPENLDAP_PID_DIR='/var/run/openldap'
OPENLDAP_DATA_DIR='/var/openldap-data' # Do *NOT* end with '/'.

# Setting for one instance. You can edit ${OPENLDAP_SLAPD_CONF} manually to hold
# multi instances.
LDAP_DATABASE='bdb' # 'bdb' or 'ldbm'. 'bdb' is recommended.
LDAP_DATA_DIR="${OPENLDAP_DATA_DIR}/${LDAP_SUFFIX_MAJOR}.${LDAP_SUFFIX_MINOR}/"

#
# Account info for all services to bind to LDAP service.
#
LDAP_SERVER_HOST='127.0.0.1'
LDAP_SERVER_PORT='389'
LDAP_BIND='yes'
LDAP_BIND_VERSION='3'

# args to start 'slapd', for 'rc.conf.local'.
OPENLDAP_FLAGS="-h ldap://${LDAP_SERVER_HOST}:${LDAP_SERVER_PORT}/ -u _openldap -g _openldap"
